//p146
#include<stdio.h>
int a = 0;
void add(char ch)
{
	int word;
	if(ch==' ')
		{
			word = 0;
		}
		else if(word == 0)
		{
			word = 1;
			a++;
			
		}
	
}
int main()
{
			int word = 0;
			char ch;
			while((ch = getchar())!='\n')
        {
			 add(ch);
		}
			printf("%d\n",a);
			return 0;
		
	}
